<template>
  <div>
    <el-button size="mini" type="primary" icon="el-icon-edit" @click="to"/>
    <eForm ref="form" :sup_this="sup_this" :is-add="false"/>
  </div>
</template>
<script>
import eForm from './form'
export default {
  components: { eForm },
  props: {
    data: {
      type: Object,
      required: true
    },
    sup_this: {
      type: Object,
      required: true
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      _this.form = {
        id: this.data.id,
        warehousename: this.data.warehousename,
        warehouselocation: this.data.warehouselocation,
        warehousedeptid: this.data.warehousedeptid,
        warehousedeptname: this.data.warehousedeptname,
        warehouselatitude: this.data.warehouselatitude,
        warehouselongitude: this.data.warehouselongitude,
        warehouseadministratorid: this.data.warehouseadministratorid,
        personname: this.data.personname,
        warehouseadministratorphone: this.data.warehouseadministratorphone,
        areacode: this.data.areacode,
      }
      console.log(this.data.state)
      if(this.data.state ===1){
            _this.form.state = "在用"
        }else if(this.data.state === 0){
          _this.form.state = "停用"
      }
      <el-table-column prop="state" label="仓库状态"/>
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>